import React from 'react';
import style from './ListItem.less';
import defaultIcon from './defaultIcon.svg';

interface ListItemProps {
  data: {
    id: string;
    // img: string;
    // title: string;
    // number1: number;
    // number2: number;
    // data: any;
  };
  handleClick: (data: {
    type: 'edit' | 'view' | 'delete' | 'changeStatus';
    data: any;
  }) => any;
}
export default function ListItem(props: ListItemProps) {
  const handleClick = (type: any) =>
    props.handleClick({ type, data: props.data });
  return (
    <div className={style.wrapper}>
      <img src={defaultIcon} alt="默认图片" className={style.leftImage} />
      <div className={style.rightMain}>
        <div className={style.mainTop}>
          <div className={style.title}>重庆瑞丰农业</div>
          <div className={style.methods}>
            <div
              className={style.methodItem}
              onClick={() => handleClick('view')}
            >
              查看
            </div>
            <div
              className={style.methodItem}
              onClick={() => handleClick('edit')}
            >
              修改
            </div>
          </div>
        </div>
        <div className={style.mainBottom}>
          <div className={style.mainBottomItem}>
            存栏量：<span>1500</span>
          </div>
          <div className={style.mainBottomItem}>
            耳标盘点数量：<span>1500</span>
          </div>
        </div>
      </div>
    </div>
  );
}
